package me.sealer.algorithm.hash.node;

/**
 * @author sealer
 * @date 2018/06/04.
 * @email 1178884049@qq.com
 */
public class VirtualServerNode implements Node {
    private int id;
    private RealServerNode realServerNode;

    public VirtualServerNode(int id, RealServerNode realServerNode) {
        this.id = id;
        this.realServerNode = realServerNode;
    }

    public RealServerNode getRealServerNode() {
        return realServerNode;
    }

    @Override
    public String genHashKey() {
        return realServerNode.toString() + "&&VN" + this.id;
    }

    @Override
    public String toString() {
        return "VirtualServerNode{" +
                "id=" + id +
                ", realServerNode=" + realServerNode +
                '}';
    }
}
